<template>
  <div class="home">
    <el-container>
      <el-header>
        <img class="logo" src="http://likede2-admin.itheima.net/img/logo.3673fab5.png" alt="" />
        <div class="user">
          <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
          <span>欢迎您，{{ $store.state.user.userdata.userName }}</span>
          <el-tooltip class="item" effect="dark" content="退出登录" placement="bottom">
            <el-button type="text" @click="exit">退出</el-button>
          </el-tooltip>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-col :span="12">
            <el-menu router :default-active="$route.path" class="el-menu-vertical-demo" text-color="#000" active-text-color="#6a83fe">
              <el-menu-item index="/likede">
                <i class="el-icon-house"></i>
                <span slot="title">立可得</span>
              </el-menu-item>
              <el-submenu index="workorder">
                <template slot="title">
                  <i class="el-icon-document"></i>
                  <span>工单管理</span>
                </template>
                <el-menu-item index="/operation">运营工单</el-menu-item>
                <el-menu-item index="/maintenance">运维工单</el-menu-item>
              </el-submenu>
              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-map-location"></i>
                  <span>点位管理</span>
                </template>
                <el-menu-item index="3-1">区域管理</el-menu-item>
                <el-menu-item index="3-2">点位管理</el-menu-item>
                <el-menu-item index="3-3">合作商管理</el-menu-item>
              </el-submenu>
              <el-submenu index="4">
                <template slot="title">
                  <i class="el-icon-printer"></i>
                  <span>设备管理</span>
                </template>
                <el-menu-item index="4-1">设备管理</el-menu-item>
                <el-menu-item index="4-2">设备状态</el-menu-item>
                <el-menu-item index="4-3">设备类型管理</el-menu-item>
              </el-submenu>
              <el-submenu index="5">
                <template slot="title">
                  <i class="el-icon-user"></i>
                  <span>人员管理</span>
                </template>
                <el-menu-item index="5-1">人员列表</el-menu-item>
                <el-menu-item index="5-2">人效统计</el-menu-item>
                <el-menu-item index="5-3">工作量列表</el-menu-item>
              </el-submenu>
              <el-submenu index="6">
                <template slot="title">
                  <i class="el-icon-sell"></i>
                  <span>商品管理</span>
                </template>
                <el-menu-item index="6-1">商品类型</el-menu-item>
                <el-menu-item index="6-2">商品管理</el-menu-item>
              </el-submenu>
              <el-menu-item index="7">
                <i class="el-icon-magic-stick"></i>
                <span slot="title">策略管理</span>
              </el-menu-item>
              <el-menu-item index="8">
                <i class="el-icon-document-copy"></i>
                <span slot="title">订单管理</span>
              </el-menu-item>
              <el-menu-item index="9">
                <i class="el-icon-money"></i>
                <span slot="title">对账管理</span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-aside>
        <el-container>
          <el-main><router-view></router-view></el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  methods: {
    exit () {
      this.$store.commit('user/exit')
      this.$router.push('/login')
    }
  },
  async created () {
  }
}
</script>

<style lang="less" scoped>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
  height: 60px;
  width: 100%;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1999;
  background-image: url();
  background-size: cover;
  background-repeat: no-repeat;
}

.logo {
  position: relative;
  top: 10px;
  left: -45vw;
  width: 88px;
}

.user {
  position: relative;
  top: -60px;
  right: -40%;
  color: #fff;
  margin-top: 2px;
  .el-button--text {
    color: #fff;
    font-size: 16px;
    margin-left: 3vh;
  }
  .el-avatar {
    position: absolute;
    top: 10px;
    right: 57%;
  }
}

.el-aside {
  background-color: #fff;
  color: #333;
  text-align: center;
  line-height: 200px;
  height: 100%;
  margin-top: 60px;
  overflow: hidden;
  width: 167px !important;
  .el-col-12 {
    width: 100%;
    text-align: left;
    .el-menu {
      border: 0px;
    }
  }
}

.el-main {
  background-color: RGB(248,250,253);
  color: #333;
  text-align: center;
  line-height: 160px;
  height: 100%;
  margin-top: 60px;
}

.el-container {
  height: 94vh;
}
</style>
